package a.h;

import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

class ac
  implements LayoutManager2
{
  private final Collection a = new ArrayList();
  private final GridBagLayout b = new GridBagLayout();
  private final b_ c = new e_(null);
  private final b_ d = new c_(null);
  private final b_ f = new d_(null);
  
  public LayoutManager a()
  {
    return new f_(null);
  }
  
  public void addLayoutComponent(String paramString, Component paramComponent)
  {
    this.b.addLayoutComponent(paramString, paramComponent);
  }
  
  public void layoutContainer(Container paramContainer)
  {
    if (ec.t == 0)
    {
      if (this.a.contains(paramContainer)) {
        return;
      }
      b();
      a(paramContainer);
      a(paramContainer, this.c);
    }
    a(paramContainer);
  }
  
  public Dimension minimumLayoutSize(Container paramContainer)
  {
    b();
    this.b.minimumLayoutSize(paramContainer);
    a(paramContainer, this.d);
    return this.b.minimumLayoutSize(paramContainer);
  }
  
  public Dimension preferredLayoutSize(Container paramContainer)
  {
    b();
    this.b.preferredLayoutSize(paramContainer);
    a(paramContainer, this.f);
    return this.b.preferredLayoutSize(paramContainer);
  }
  
  public void removeLayoutComponent(Component paramComponent)
  {
    this.b.removeLayoutComponent(paramComponent);
  }
  
  public void addLayoutComponent(Component paramComponent, Object paramObject)
  {
    int i = ec.t;
    if (i == 0) {
      if ((paramObject instanceof hd))
      {
        this.b.addLayoutComponent(paramComponent, ((hd)paramObject).a());
        if ((i == 0) && (!(paramComponent instanceof Container))) {
          return;
        }
        Container localContainer = (Container)paramComponent;
        if (i == 0)
        {
          if (!(localContainer.getLayout() instanceof f_)) {
            return;
          }
          if (i != 0) {
            break label87;
          }
          this.a.add(localContainer);
        }
      }
    }
    if ((ec.s) && (paramObject != null)) {
      label87:
      throw new IllegalArgumentException("cannot add to layout: constraints must be a ContainerConstraint");
    }
  }
  
  public float getLayoutAlignmentX(Container paramContainer)
  {
    return this.b.getLayoutAlignmentX(paramContainer);
  }
  
  public float getLayoutAlignmentY(Container paramContainer)
  {
    return this.b.getLayoutAlignmentY(paramContainer);
  }
  
  public void invalidateLayout(Container paramContainer)
  {
    this.b.invalidateLayout(paramContainer);
  }
  
  public Dimension maximumLayoutSize(Container paramContainer)
  {
    return this.b.maximumLayoutSize(paramContainer);
  }
  
  private void a(Container paramContainer)
  {
    boolean bool = ec.s;
    this.b.layoutContainer(paramContainer);
    Iterator localIterator = this.a.iterator();
    do
    {
      if (!localIterator.hasNext()) {
        break;
      }
      Container localContainer = (Container)localIterator.next();
      localContainer.getLayout().layoutContainer(localContainer);
    } while (!bool);
  }
  
  private void b()
  {
    boolean bool = ec.s;
    this.b.columnWidths = null;
    Iterator localIterator = this.a.iterator();
    do
    {
      if (!localIterator.hasNext()) {
        break;
      }
      Container localContainer = (Container)localIterator.next();
      ((GridBagLayout)localContainer.getLayout()).columnWidths = null;
    } while (!bool);
  }
  
  private void a(Container paramContainer, b_ paramb_)
  {
    int n = ec.t;
    boolean bool = ec.s;
    int i = 0;
    int j = 0;
    Object localObject = this.a.iterator();
    Container localContainer;
    GridBagLayout localGridBagLayout;
    GridBagConstraints localGridBagConstraints;
    Insets localInsets;
    Component localComponent;
    do
    {
      int m;
      do
      {
        do
        {
          do
          {
            if (!((Iterator)localObject).hasNext()) {
              break;
            }
            localContainer = (Container)((Iterator)localObject).next();
            localGridBagLayout = (GridBagLayout)localContainer.getLayout();
            localGridBagConstraints = this.b.getConstraints(localContainer);
          } while (localGridBagConstraints.gridx != 0);
          localInsets = localContainer.getInsets();
          if (n == 0)
          {
            i = Math.max(i, localInsets.left);
            if ((n != 0) || (bool)) {
              break label195;
            }
          }
          k = localContainer.getComponentCount();
          m = 0;
        } while (m >= k);
        localComponent = localContainer.getComponent(m);
        localGridBagConstraints = localGridBagLayout.getConstraints(localComponent);
      } while (bool);
      if (localGridBagConstraints.gridx == 0)
      {
        if (n != 0) {
          continue;
        }
        if (localGridBagConstraints.gridwidth == 1) {
          j = Math.max(j, paramb_.a(localComponent));
        }
      }
      m++;
    } while (!bool);
    label195:
    localObject = paramContainer.getComponents();
    int k = 0;
    do
    {
      if (k >= localObject.length) {
        break;
      }
      localComponent = localObject[k];
      if (bool) {
        break label326;
      }
      if (n == 0)
      {
        if (!this.a.contains(localComponent))
        {
          localGridBagConstraints = this.b.getConstraints(localComponent);
          if (n != 0) {
            continue;
          }
          if (localGridBagConstraints.gridx == 0)
          {
            if (n != 0) {
              continue;
            }
            if (localGridBagConstraints.gridwidth == 1)
            {
              localInsets = localGridBagConstraints.insets;
              j = Math.max(j, paramb_.a(localComponent) + localInsets.left + localInsets.right);
            }
          }
        }
        k++;
      }
    } while (!bool);
    label326:
    Iterator localIterator = this.a.iterator();
    if (localIterator.hasNext()) {}
    while (n != 0)
    {
      localContainer = (Container)localIterator.next();
      localGridBagLayout = (GridBagLayout)localContainer.getLayout();
      localGridBagLayout.columnWidths = new int[] { i - localContainer.getInsets().left + j };
      if ((n == 0) && (bool)) {
        return;
      }
      if (!bool) {
        break;
      }
    }
    this.b.columnWidths = new int[] { i + j };
  }
  
  private static final class f_
    extends GridBagLayout
  {
    private f_() {}
    
    public void addLayoutComponent(Component paramComponent, Object paramObject)
    {
      int i = ec.t;
      if (i == 0) {
        if ((paramObject instanceof hd))
        {
          if (i != 0) {
            break label41;
          }
          super.addLayoutComponent(paramComponent, ((hd)paramObject).a());
        }
      }
      if ((ec.s) && (paramObject != null)) {
        label41:
        throw new IllegalArgumentException("cannot add to layout: constraints must be a ContainerConstraint");
      }
    }
    
    f_(ac.0 param0)
    {
      this();
    }
  }
  
  private static final class d_
    implements ac.b_
  {
    private d_() {}
    
    public int a(Component paramComponent)
    {
      return paramComponent.getPreferredSize().width;
    }
    
    d_(ac.0 param0)
    {
      this();
    }
  }
  
  private static final class c_
    implements ac.b_
  {
    private c_() {}
    
    public int a(Component paramComponent)
    {
      return paramComponent.getMinimumSize().width;
    }
    
    c_(ac.0 param0)
    {
      this();
    }
  }
  
  private static final class e_
    implements ac.b_
  {
    private e_() {}
    
    public int a(Component paramComponent)
    {
      return paramComponent.getWidth();
    }
    
    e_(ac.0 param0)
    {
      this();
    }
  }
  
  private static abstract interface b_
  {
    public abstract int a(Component paramComponent);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.ac

 * JD-Core Version:    0.7.0.1

 */